<%--
  Created by IntelliJ IDEA.
  User: zzz
  Date: 2020/2/11
  Time: 9:19
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <link rel="stylesheet" type="text/css" href="${APP_PATH}/css/pagination.css"/>
</head>
<body>
<div id="getOrder" hidden></div>

<div id="getPaging" class="pagination" style="margin: 0 auto;">
</div>
</body>
</html>
<script src="${APP_PATH}/portal/js/jquery-1.12.4.min.js" type="text/javascript" charset="utf-8"></script>
<script>
    $(function () {
        getOrder(1);
    });
    function getOrder(page) {
        $.ajax({
            url : "${APP_PATH}/order/findAllOrder",
            method : "GET",
            data : {
                pageNo : page,
                likeName : $("#likeName").val(),
                otype : 0,
                methodName : "getOrder"
            },
            success : function (result) {
                if(result.success){
                    var orderInfoList = result.data.datas;
                    var pageContent = result.data.pageContent;
                    var orderContent = "";
                    var paytype = "";
                    for(var i = 0; i < orderInfoList.length; i++){
                        if(orderInfoList[i].order.paytype == 1){
                            paytype = "在线支付";
                        }else {
                            paytype = "货到付款";
                        }
                        orderContent +='<div class="dkuang deng">';
                        orderContent +='<p class="one ">待发货</p>';
                        orderContent +='<div class="word clearfix">';
                        orderContent +='<ul class="fl clearfix">';
                        orderContent +='<li>'+orderInfoList[i].order.otime+'</li>';
                        orderContent +='<li>'+orderInfoList[i].addressInfo.address.consignee+'</li>';
                        orderContent +='<li>订单号:'+orderInfoList[i].order.onum+'</li>';
                        orderContent +='<li>'+paytype+'</li>';
                        orderContent +='</ul>';
                        orderContent +='<p class="fr">订单金额：<span>'+orderInfoList[i].order.oprice.toFixed(2)+'</span>元</p>';
                        orderContent +='</div>';
                        var pre_orderInfoList = orderInfoList[i].pre_orderInfoList;
                        for(var j = 0; j < pre_orderInfoList.length; j++){
                            orderContent +='<div class="shohou clearfix">';
                            orderContent +='<a href="javascrpit:;" class="fl"><img src="${APP_PATH}/'+pre_orderInfoList[j].furnitureKinds.fkface+'"/></a>';
                            orderContent +='<p class="fl"><a href="javascrpit:;">'+pre_orderInfoList[j].furniture.fname+' '+pre_orderInfoList[j].furnitureKinds.fkname+'</a><a href="javascrpit:;">¥'+pre_orderInfoList[j].furnitureKinds.fkprice.toFixed(2)+'×'+pre_orderInfoList[j].pre_order.count+'</a></p>';
                            orderContent +='<p class="fr">';
                            if(j == 0){
                                orderContent +='<a href="${APP_PATH}/toOrderDetail?oid='+orderInfoList[i].order.oid+'">订单详情</a>';
                            }
                            orderContent +='</p>';
                            orderContent +='</div>';
                        }
                        orderContent +='</div>';
                    }
                    $("#getOrder").html(orderContent);
                    $("#getPaging").html(pageContent);
                    logRender();
                }
            }
        });
    }
</script>